//import Request from '@/utils/request'
import {getStorage,setStorage} from '@/utils/common.js'
const state = () => ({
	userInfo:JSON.parse(getStorage('userInfo') || '{}'),
	selectTeacher:'',
	backUrl:'',
	orderInfo:{}
	
})
const getters = {
	userInfo(state) {
		return state.userInfo;
	},
	selectTeacher(state) {
		return state.selectTeacher;
	},
}
const mutations = {
	set_userInfo: (state, obj) => {
		Object.assign(state.userInfo,obj)
		setStorage('userInfo',JSON.stringify(state.userInfo))
	},
	set_selectTeacher: (state, obj) => {
		state.selectTeacher = obj
	},
	set_backUrl: (state, url) => {
		state.backUrl = url
	},
	init_orderInfo: (state, obj) => {
		state.orderInfo = obj
	},
	set_orderInfo: (state, obj) => {
		Object.assign(state.orderInfo,obj)
	},
}
const actions = {
	
}

export default {
	namespaced: true,
	state,
	getters,
	mutations,
	actions
}
